#pragma once

#include "Sol9Types.h"
#include "Keycode.h"

namespace sol9
{

	enum eEventType
	{
		EET_MouseInput,
		EET_KeyInput,
		EET_Count,
	};

	enum eMouseInputEvent
	{
		EMIE_MouseMove,

		EMIE_LButtonDown,
		EMIE_LButtonUp,
		EMIE_LButtonDClick,

		EMIE_RButtonDown,
		EMIE_RButtonUp,
		EMIE_RButtonDClick,

		EMIE_MButtonDown,
		EMIE_MButtonUp,
		EMIE_MButtonDClick,

		EMIE_MouseWheel,

		EMIE_Count,
	};

	struct SEvent
	{
		struct SMouseInput
		{
			s32 x;
			s32 y;
			f32 w;

			bool pressedShift;
			bool pressedControl;

			eMouseInputEvent event;
		};

		struct SKeyInput
		{
			bool pressedKey;
			bool pressedShift;
			bool pressedControl;

			eKeyCode key;
		};

		union
		{
			SMouseInput mouse;
			SKeyInput key;
		};

		eEventType type;
	};

	class IEventReceiver
	{
	public:
		virtual ~IEventReceiver() {}
		virtual bool OnEvent(const SEvent& event) = 0;
	};

} // namespace sol9
